package com.ruoyi.community.service.hospital;


import com.ruoyi.community.mapper.hospital.OtherMapper;
import com.ruoyi.community.mapper.hospital.UserMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class OtherService
{
    @Resource
    OtherMapper otherMapper;

    @Resource
    UserMapper userMapper;

    public int getRole(String open_id)
    {
        return userMapper.login(open_id).getRole();
    }

    public String registerUser(String community_id, String age, String name, String open_id, String phoneNumber, String role)
    {
        if(userMapper.login(open_id) != null)
            return "已注册";
        otherMapper.registerUser(community_id, age, name, open_id, phoneNumber, role);
        return "success";
    }

    public void forwardStage(String open_id)
    {
        otherMapper.forwardStage(open_id);
    }
}
